package com.yumeng.common.auth;

import com.yumeng.common.data.enums.AuthClientType;

import java.util.Objects;

/**
 * 通用认证详情
 *
 * @author wxd
 * @date 2025/3/26 14:48
 */
public final class CommAuthDetails {

    private String sessionId;
    private String remoteAddress;
    private AuthClientType authClientType;

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getRemoteAddress() {
        return remoteAddress;
    }

    public void setRemoteAddress(String remoteAddress) {
        this.remoteAddress = remoteAddress;
    }

    public AuthClientType getAuthClientType() {
        return authClientType;
    }

    public void setAuthClientType(AuthClientType authClientType) {
        this.authClientType = authClientType;
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        CommAuthDetails details = (CommAuthDetails) o;
        return Objects.equals(sessionId, details.sessionId)
                && Objects.equals(remoteAddress, details.remoteAddress)
                && authClientType == details.authClientType;
    }

    @Override
    public int hashCode() {
        return Objects.hash(sessionId, remoteAddress, authClientType);
    }
}
